<?php
namespace app\controllers;

use Yii;
use common\models\LoginForm;
use app\models\PasswordResetRequestForm;
use app\models\ResetPasswordForm;
use app\models\SignupForm;
use app\models\ContactForm;
use yii\base\InvalidParamException;
use yii\web\BadRequestHttpException;
use yii\web\Controller;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;

/**
 * Site controller
 */
class TestController extends Controller
{
    public function actionIndex() {
        
        echo \yii\helpers\Url::to('@apiUrl/qun/order/index?token=adfasdf');die;
        echo \yii\helpers\Url::to(['tset/index']);
        echo \Yii::$app->request->get('wid');
        die;
    }
    
    public function actionUpload() {
        return $this->render('upload');
    }
    
    public function actionWechat() {
        
        $options = [
            'debug'     => false,
            'app_id'    => 'wx3f3ea1dd10a39cc2',
            'secret'    => '63005e31fd1ca750e9606764ead600dc',
            'token'     => 'LYw4GLO4Fx3Xkfx90FzAyF804bOesf9F',
            'log' => [
                'level' => 'debug',
                'file'  => '/tmp/easywechat.log',
            ],
            'verify'
            // ...
        ];
        $openid = 'oaRLUvjjgdqT7SwYeGEuOoy5PibI';
        $message = 'hello wechat';
        $app = new \EasyWeChat\Foundation\Application($options);
        $result = $app->staff->message($message)->to($openid)->send();
        
    var_dump($result);
        die;
    }
}
